/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package main;

import app.Code;
import app.GrammarFunctions;
import app.Lexico;
import app.Token;
import exceptions.LexicoException;
import exceptions.SemanticoException;
import exceptions.SintaticoException;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.LinkedList;

/**
 *
 * @author User
 */
public class MainSintatico {
     public static void main(String[] args) {
        try {
            Lexico lexico = new Lexico("teste.jj");

            LinkedList<Token> list = lexico.getList();
            
            GrammarFunctions sintatico = new GrammarFunctions(list);
            
            for(Token t : list){
                System.out.println(t.getSimbol() + 
                    "\t" + Code.getGenericDescrition(t.getCode()) +
                    "\t" + t.getLine());
            }
        } catch (FileNotFoundException ex) {
            ex.printStackTrace();
        } catch (IOException ex){
            ex.printStackTrace();
        } catch (SemanticoException ex) {
            ex.printStackTrace();
        }
        catch (SintaticoException ex){
            ex.printStackTrace();
        } catch (LexicoException ex){
            ex.printStackTrace();
        }
    }
}
